/*
 * Copyright (C) 2008 The Android Open Source Project
 *
 * Licensed under the Eclipse Public License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.eclipse.org/org/documents/epl-v10.php
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lt.egidijus.aatest.properties;

import lt.egidijus.aatest.utils.Constants;

import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.dialogs.PropertyPage;

/**
 * Property page for "Android" project.
 * This is accessible from the Package Explorer when right clicking a project and choosing
 * "Properties".
 *
 */
public class AATestCustomTypePropertyPage extends PropertyPage {

	private Text testProjectName;
	private Text testPostfixName;
	private Text testPostfixRandomName;
	private Text testPostfixOCLName;
	private Text testPostfixGeneticName;
	private Button generateSetGetButton;

    public AATestCustomTypePropertyPage() {

    }

    @Override
    protected Control createContents(Composite parent) {
    	GridData gridData = new GridData();
		gridData.horizontalSpan = 2;
		gridData.horizontalAlignment = SWT.FILL;
		gridData.grabExcessHorizontalSpace = true;
		gridData.verticalAlignment = SWT.FILL;
		gridData.grabExcessVerticalSpace = true;

		Composite container = new Composite(parent, SWT.NULL);
//
//		GridLayout layout = new GridLayout();
//		container.setLayout(layout);
//		layout.numColumns = 2;
//		layout.verticalSpacing = 4;
//		layout.horizontalSpacing = 2;
//		Label labelTestingProject = new Label(container, SWT.NULL);
//		labelTestingProject.setText("Testing project name:");
//		testProjectName = new Text(container, SWT.FILL | SWT.BORDER);
//		testProjectName.setTextLimit(30);
//		testProjectName.setText(Constants.testProjectName);
//		testProjectName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//		
//		Label labelTestPostfixName = new Label(container, SWT.NULL);
//		labelTestPostfixName.setText("Test posfix of class:");
//		testPostfixName = new Text(container, SWT.FILL | SWT.BORDER);
//		testPostfixName.setTextLimit(30);
//		testPostfixName.setText(Constants.testClassPostfix );
//		testPostfixName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//		
//		Label labelTestPostfixRandomName = new Label(container, SWT.NULL);
//		labelTestPostfixRandomName.setText("Test posfix of random test:");
//		testPostfixRandomName = new Text(container, SWT.FILL | SWT.BORDER);
//		testPostfixRandomName.setTextLimit(30);
//		testPostfixRandomName.setText(Constants.randomPostfix );
//		testPostfixRandomName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//		
//		Label labelTestPostfixOCLName = new Label(container, SWT.NULL);
//		labelTestPostfixOCLName.setText("Test posfix of OCL test:");
//		testPostfixOCLName = new Text(container, SWT.FILL | SWT.BORDER);
//		testPostfixOCLName.setTextLimit(30);
//		testPostfixOCLName.setText(Constants.OCLPostfix );
//		testPostfixOCLName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//		
//		Label labelTestPostfixGeneticName = new Label(container, SWT.NULL);
//		labelTestPostfixGeneticName.setText("Test posfix of  genetic class:");
//		testPostfixGeneticName = new Text(container, SWT.FILL | SWT.BORDER);
//		testPostfixGeneticName.setTextLimit(30);
//		testPostfixGeneticName.setText(Constants.geneticPostfix );
//		testPostfixGeneticName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//		
//		generateSetGetButton = new Button(container, SWT.CHECK);
//		generateSetGetButton.setText("Generate Set/Get method");
//		generateSetGetButton.setSelection(Constants.generateSetGetMethod);
		
		return container;
    }

    @Override
    public boolean performOk() {
//    	Constants.testProjectName = testProjectName.getText();
//    	Constants.testClassPostfix = testPostfixName.getText();
//    	Constants.generateSetGetMethod = generateSetGetButton.getSelection();
//    	Constants.randomPostfix = testPostfixRandomName.getText();
//       	Constants.OCLPostfix = testPostfixOCLName.getText();
//       	Constants.geneticPostfix = testPostfixGeneticName.getText();
        return true;
    }
    



    @Override
    protected void performDefaults() {

    }

}
